package com.david.equipment.controller;

import com.david.equipment.pojo.entity.EquipProcess;
import com.david.equipment.service.ProcessService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import static com.david.common.utils.ResultUtils.success;

@RestController
@RequestMapping("/equipment/process")
@Api(tags = "流程配置")
@RequiredArgsConstructor
@Slf4j
public class ProcessController {
    final ProcessService processService;

    @GetMapping("/list")
    @ApiOperation(value = "查询流程列表")
    public ResponseEntity<Object> getlist() {
        return success(true,processService.getlist());
    }

    @PostMapping("/edit")
    @ApiOperation(value = "编辑流程配置")
    public ResponseEntity<Object> editProcess(@RequestBody EquipProcess process) {
        log.info("编辑流程配置{}",process);
        return success(true,processService.editProcess(process));
    }
}
